package com.atguigu.day10;

public class Test01 {
    public static void main(String[] args) {
        A1 a = new B1();
        System.out.println(a.num);
        System.out.println(((B1)a).num);
        System.out.println(((A1)((B1)a)).num);
        System.out.println("-------------------");
        B1 b = new B1();
        System.out.println(b.num);
        System.out.println(((A1)b).num);
        System.out.println(((B1)((A1)b)).num);
    }
}
class A1{
    int num = 1;
}
class B1 extends A1{
    int num = 2;
}
/*
1
        2
        1
        -------------------
        2
        1
        2*/
